﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using System.Data;

namespace BLL
{
    public class BindIdBLL
    {
	private BindIdDAL bd = new BindIdDAL();

	public bool verifyId(string openid)
	{
	    return this.bd.verifyOpenid(openid);
	}

	public DataTable verifyUser(string CardId,string UserName,  string pwd,  string UA)
	{
	    return this.bd.verifyUser(CardId,UserName,  pwd, UA);
	}
    public DataTable verifyUser_Tel(string CardId, string UserName, string CUST_ID)
    {
            return this.bd.verifyUser_Tel(CardId, UserName, CUST_ID);
    }

    public bool insertUser(string cardid, string name, string openid)
	{
	    return this.bd.insertUser(cardid, name, openid);
	}
		/// <summary>
		/// 水控消费
		/// </summary>
		/// <param name="machinenumber"></param>
		/// <param name="carnumber"></param>
		/// <param name="money"></param>
		/// <param name="xfjh"></param>
		/// <param name="consumption_type">00：水控消费</param>
		/// <param name="deduction_type1"></param>
		/// <param name="consumption_type1"></param>
		/// <param name="transdtTm"></param>
		/// <param name="xffs"></param>
		/// <param name="cdmc"></param>
		/// <param name="number"></param>
		/// <param name="MenuId"></param>
		/// <param name="ordernumber"></param>
		/// <returns></returns>
		public static int warteIn(string machinenumber, string carnumber, double money, string xfjh, string consumption_type, string deduction_type1, string consumption_type1, string transdtTm, string xffs, string cdmc, int number, int MenuId, string ordernumber) 
		{
			return BindIdDAL.warteIn(machinenumber,carnumber,money,xfjh,consumption_type,deduction_type1,consumption_type1,transdtTm,xffs,cdmc,number,MenuId,ordernumber);
		}

	public bool delUser(string openid)
	{
	    return this.bd.delUser(openid);
	}





		/// <summary>
		/// 获取当前用户出水工作状态
		/// </summary>
		/// <param name="openid"></param>
		/// <returns></returns>
		public static DataTable wkstate_lssj(string carnumber) 
		{
			return BindIdDAL.wkstate_lssj(carnumber);
		}
		/// <summary>
		/// 更新水控状态
		/// </summary>
		/// <param name="openid"></param>
		/// <returns></returns>
		public static int wkstate_update(string carnumber, int jh, int wkstate)
		{
			return BindIdDAL.wkstate_update(carnumber, jh, wkstate);
		}
		/// <summary>
		/// 获取系统参数设置
		/// </summary>
		/// <param name="openid"></param>
		/// <returns></returns>
		public static DataTable systemset() 
		{
			return BindIdDAL.systemset();
		}

        //获取openid值，卡号，姓名，密码
        public DataSet getUserInfo3(string openid)
        {
            return bd.getUserInfo3(openid);
        }

        public int getUserInfo4(string openid)
        {
            return bd.getUserInfo4(openid);
        }
        /// <summary>
        /// 获取人员信息
        /// </summary>
        /// <param name="openid"></param>
        /// <returns></returns>
        public static  DataTable getryxx(string openid) 
		{
			return BindIdDAL.getryxx(openid);
		}
	//获取最新的地址和电话
		public static DataTable Torage(string openid) 
	{
	    return BindIdDAL.Torage(openid);
	}

        public static DataTable getcanteen(string OrderId)
        {
            return BindIdDAL.getcanteen(OrderId);
        }

        public static DataTable get_orderdetail(string OrderId)
        {
            return BindIdDAL.get_orderdetail(OrderId);
        }


            #region 获取绑定卡号是否绑定 1，0是未绑定 2，1是已绑定
            public static int BinDingRfkh(string Opid)
	{
	    return BindIdDAL.BinDingRfkh(Opid);
	}
	#endregion

	#region 绑定卡号
	public static int BinDingrfkhs(string rfkh, string password, string Opid) 
	{
	    return BindIdDAL.BinDingrfkhs(rfkh,password,Opid);
	}
	#endregion

	#region 修改状态绑定 1. 0未绑定 2.1已绑定
	public static int Updaterfkh(string password, string Opid)
	{
	    return BindIdDAL.Updaterfkh(password,Opid);
	}
	#endregion

	#region 判断卡号
	public static int BinDingkh(string rfkh) 
	{
	    return BindIdDAL.BinDingkh(rfkh);
	}
	#endregion

	#region 绑定卡号Opid表
	public static int IdBanDin(string rfkh, string Opid) 
	{
	    return BindIdDAL.IdBanDin(rfkh,Opid);
	}
	#endregion

	#region 判断密码是否正确
	public static int judgePassword(string password, string Opid)
	{
	    return BindIdDAL.judgePassword(password,Opid);
	}
	#endregion
    }
}
